package com.movie.demo.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.movie.demo.pojo.Seat;
import com.movie.demo.pojo.vo.SeatInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SeatMapper extends BaseMapper<Seat> {
    @Select("SELECT a.id,e.cname,b.chinese_name,d.r_name,c.time,a.seat,a.flag FROM seat a,movie b,arrange c,room d,cinema e\n" +
            "WHERE a.mid=b.mid and a.room_id=d.id and a.session_id=c.id and a.cinema_id=e.cid")
    List<SeatInfo> selectSeatInfo();

//    @Select("SELECT a.id,e.cname,b.chinese_name,d.r_name,c.time,a.seat,a.flag,a.uid FROM seat a,movie b,arrange c,room d,cinema e \n" +
//            "WHERE a.mid=b.mid and a.room_id=d.id and a.session_id=c.id and a.cinema_id=e.cid AND\n" +
//            "a.mid=#{mid} and a.session_id=#{session_id} and a.room_id=#{room_id} AND a.cinema_id=#{cinema_id} and a.seat=#{seat}")
//    SeatInfo selectSeatInfoOne(int mid, int session_id, int room_id, int cinema_id, String seat);
}
